/*
 * Jiekou.h
 *
 *  Created on: 2022年7月22日
 *      Author: wocao
 */
#include <cstdio>
#include <fstream>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
#include <uuid/uuid.h>
#include <thread>
#include "../cunchuti/kongzhi/kongzhi_impl/kongzhi_impl1.h"
#include "../cunchuti/kongzhi/Kongzhi.h"
#include "../wenjianceng/kongzhi/kongzhi_impl/Wenjiankongzhiimpl1.h"
#include "../Serializable/Serializable.hpp"
#include "../wenjianceng/kongzhi/Wenjiankongzhi.h"
using namespace std;
#ifndef JIEKOUCENG_JIEKOU_H_
#define JIEKOUCENG_JIEKOU_H_

class Jiekou {
public:
	Jiekou(Cunchuti_kongzhi *ckz);
	virtual ~Jiekou();
	Cunchuti_kongzhi *c_kz = 0;
	Wenjian_kongzhi *w_kz = 0;
	void add_file_thread(RW_status_cache &rwcache, Wenjian *wenjian,
			Wenjian_kongzhi *pw);
	void get_file_thread(RW_status_cache &rwcache, const string &file_name,
			Wenjian_kongzhi *pw);
	void add_file(RW_status_cache &rwcache, Wenjian *wenjian);
	void get_file(RW_status_cache &rwcache, const string &file_name);
	void rem_file(const string &file_name);
	void creat_dir(const string &new_dir);
	void qiehuan_dir(const string &dir);
	void add_cunchuti(const string &path);
	unsigned long get_used_size();
	unsigned long get_all_size();
	unsigned long get_now_dir(char **buf);
	double get_used_baifenbi();
};

#endif /* JIEKOUCENG_JIEKOU_H_ */
